using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class GameManager : MonoBehaviour
{
    static GameManager instance;
    float gameTime;
    public int deathCount;
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;
        DontDestroyOnLoad(this);
    }
    void Update()
    {
        gameTime += Time.deltaTime;
        UIManager.UpdateTime(gameTime);
    }

    public static void PlayerDied()
    {
        instance.deathCount++;
        UIManager.UpdateDeath(instance.deathCount);
    }
}
